import request from '../request'

// 获取角色列表
export function getRoleManage(params) {
  return request({
    url: '/hRoleManage/getRoleManage',
    method: 'post',
    data: params
  })
}

// 获取权限菜单
export function getAllMenu(params) {
  return request({
    url: '/hSysMenu/getAllMenu',
    method: 'get',
    params
  })
}

// 新增
export function insertRole(params) {
  return request({
    url: '/hRoleManage/insert',
    method: 'post',
    data: params
  })
}

// 编辑
export function editRole(params) {
  return request({
    url: '/hRoleManage/edit',
    method: 'put',
    data: params
  })
}

// 删除
export function deleteRole(params) {
  return request({
    url: `/hRoleManage/delete?id=${params.id}`,
    method: 'DELETE'
  })
}

// 点击角色获取权限
export function watchOutRoleMenu(params) {
  return request({
    url: '/hRoleFunction/watchOutRoleMenu',
    method: 'get',
    params
  })
}

// 新增角色权限
export function insertPower(params) {
  return request({
    url: '/hRoleFunction/insert',
    method: 'post',
    data: params
  })
}

// 查看角色详情
export function getRoleById(params) {
  return request({
    url: '/hRoleManage/getRoleById',
    method: 'get',
    params
  })
}

